package com.shushan.pages;

import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.shushan.base.NavigationLoseActivity;
import com.shushan.shushanbao.R;
import com.tencent.smtt.sdk.WebSettings;
import com.tencent.smtt.sdk.WebView;


/**
 * @ClassName: SubscriptionStepsActivity
 * @Desciption: //订阅步骤介绍页面
 * @author: zhangshihao
 * @date: 2018-04-28
 */
public class SubscriptionStepsActivity extends NavigationLoseActivity {

    private WebView webView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_subscription_des);
        setTitle("书山宝家长端使用说明");

        webView = findViewById(R.id.webview);

        WebSettings mWebSettings = webView.getSettings();
        mWebSettings.setSupportZoom(true);
        mWebSettings.setLoadWithOverviewMode(true);
        mWebSettings.setUseWideViewPort(true);
        mWebSettings.setDefaultTextEncodingName("utf-8");
        mWebSettings.setLoadsImagesAutomatically(true);
        mWebSettings.setBlockNetworkImage(false);//解决图片不显示
        mWebSettings.setTextZoom(100);//设置默认缩放比例，防止网页跟随系统字体大小变化
        //调用JS方法.安卓版本大于17,加上注解 @JavascriptInterface
        mWebSettings.setJavaScriptEnabled(true);

        if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
            mWebSettings.setMixedContentMode(android.webkit.WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
        }

        webView.loadUrl("https://tpi.shushan.com/dist/guide.html");
    }
}
